package com.itheima.service.impl;

import com.itheima.mapper.UserMapper;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    //登录
    @Override
    public User login(User user) {
        //调用mapper完成用户名密码的对象查询
        User loginUser = userMapper.selectByUsernameAndPassword(user);
//        System.out.println(1/0);
        return loginUser;
    }
}
